package com.example.demo.task;

import com.example.demo.order.service.IZlb;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Created at 2021/3/1 3:50 下午
 *
 * @author Alex
 * description
 */
@Component
public class OverduleUploadTask {
    @Autowired
    private IZlb zlb;
    private Logger LOGGER = LoggerFactory.getLogger(OverduleUploadTask.class);

    /**
     * cron表达式：Seconds Minutes Hours DayofMonth Month DayofWeek [Year]
     * 每天七点扫描一次，逾期7天的客户上报租赁宝
     */
    @Scheduled(cron = "0 0 7 * * ?")
    private void uploadOverdule() throws InterruptedException {
        LOGGER.info("逾期超7天后上报租赁宝");
        zlb.uploadOrderRentalInfo("1");
    }
}
